﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DTO;
using DAL;
using BUS;
namespace WEBSITE_BANDEAL.Front
{
    
    public partial class Dangky : System.Web.UI.Page
    {
        KHACH_HANGBUS khb = new KHACH_HANGBUS();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
                LoadData();

        }

        private void LoadData()
        {
            //Load Tinh Thanh
            TINH_TP.DataSource = TINH_TPBUS.GetAll();
            TINH_TP.DataTextField = "Ten_tp";
            TINH_TP.DataValueField = tinh_tpColumns.Ma_tinh.ToString();
            TINH_TP.DataBind();
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            try
            {
                KHACH_HANG k = new KHACH_HANG();
                k.TenKhachHang = Hoten.Text;
                k.MatKhau = Matkhau.Text;
                k.Email = Email.Text;
                string tinhtp = TINH_TP.SelectedItem.Text;
                k.DiaChi = Diachi.Text +" - "+tinhtp;
                k.DienThoai = Dienthoai.Text;
                khb.KhachHang_Them(k);
                //Rekhonse.Redirect("SanPham_List.akhx");
            }
            catch
            { }
        }
    }
}